"""
练习1：求1-100的和
练习2：求5的阶乘：5! = 5 * 4 * 3 * 2 * 1
练习3：打印输出58-23
练习4：打印1-100内的奇数。每行打印10个。
    奇数：不能被2整除的数，
        1   3   5   7   9   11  ...
    偶数：能够被2整除的数
        2   4   6   8   10  ...
"""

# a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
# print(range(10))
# print(list(range(100)))

# for i in range(10):
#     print(i)
# sum1 = 0
# for i in range(1, 101):
#     sum1 += i
#
# print(sum1)

# sum1=0
# sum2=sum1+1
# while True:
#     sum1<100
#     sum1=sum1+sum2

# i = 1
# sum = 0
# while i < 101:
#     sum = sum + i
#     i += 1
# print(sum)

# 1 + 2 + 3 + 4+ ----- + 100

sum1 = 0
i = 1
while i < 101:
    sum1 = sum1 + i
    i += 1
print(sum1)
# 5! = 5 * 4 * 3 * 2 * 1

res = 1
i = 1
while i < 6:
    res *= i
    i += 1
print(res)

# 打印输出58-23

# i = 58
# while i > 22:
#     print(i)
#     i -= 1
# 打印1-100内的奇数。每行打印10个。

i = 1
count = 0
while i < 101:
    print(i,end=' ')
    count += 1
    i += 2
    if count % 10 == 0:
        print()

